from django.db import models

# Create your models here.

class User(models.Model):
    username = models.CharField(max_length=200)
    user_level = models.CharField(max_length=10)
    score = models.CharField(max_length=200)

    class Meta:
        db_table='user'

class News(models.Model):
    title = models.CharField(max_length=200)
    content = models.CharField(max_length=200)

    class Meta:
        db_table='news'

class P(models.Model):
    Pl = models.CharField(max_length=200)
    uid = models.ForeignKey(User,on_delete=models.CASCADE)
    nid = models.ForeignKey(News,on_delete=models.CASCADE)

    class Meta:
        db_table='p'

